<?php
/*
 * Created on Sep 22, 2013
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 require_once 'constants.php';
 $con = get_connection();
 $ticket_amount = $_REQUEST['ticket_amount'];
 $event_id=$_REQUEST['event_id'];
 $user='769082159';
 $user = $fb->getUser();
 $query="SELECT seat_name, row_no, section, price, user_id, status, seat_no FROM hh_seat_allocate_$event_id where user_id=$user";
 $result = mysql_query($query);
 
 // Get the event details
 $access_token = $fb->getAccessToken();
 //echo $event_id;
 $data = $fb->api(
'/'.$event_id.'/',
'GET', array(
  "access_token" => $access_token
  ) );
  $date = $data["start_time"];
 ?>
 <html>
<head>
<style>
table{
	border:3px solid black;
}
</style>
</head>
<body>
<?php
while ($row = mysql_fetch_assoc($result)) {
	//echo $row["seat_name"];
	

?>
<table>
<col style="width: 10em" />
<col style="width: 20em" />
<col style="width: 10em; border-style: dotted;"/>
<tr>
<td></td>
<td style="margin:auto;"><h2>Ticket for the event<h2></td>

<td></td>
</tr>

<tr>
<td><?php echo "PRICE : $ticket_amount<br />Row no : ".$row['row_no']."<br \>Section : ".$row['section']."<br \> Seat name : ".$row["seat_name"];?></td>
<td><?php 
$pageContent = file_get_contents('http://graph.facebook.com/'.$fb->getUser());
$parsedJson  = json_decode($pageContent);
echo $parsedJson->name;
?>
</td>
<td><?php echo "PRICE : ".$ticket_amount."<br />Paid";?></td>
</tr>
<tr>
<td></td>
<td style="text-align:right;">
<?php echo "Event date : ".$date;?>

<td></td>

</tr>
</table>
<?php 
echo "<br />";}
?>
</body>
</html>